package com.zrrd.yunchmall.sale.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zrrd.yunchmall.sale.entity.FlashPromotionProductRelation;
import com.zrrd.yunchmall.sale.mapper.FlashPromotionProductRelationMapper;
import com.zrrd.yunchmall.sale.service.IFlashPromotionProductRelationService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 商品限时购与商品关系表 服务实现类
 * </p>
 *
 * @author LYY
 * @since 2024-01-15
 */
@Service
public class FlashPromotionProductRelationServiceImpl extends ServiceImpl<FlashPromotionProductRelationMapper, FlashPromotionProductRelation> implements IFlashPromotionProductRelationService {

    @Autowired
    private FlashPromotionProductRelationMapper promotionProductRelationMapper;

    @Override
    public IPage<FlashPromotionProductRelation> selectProducts(int pageNum, int pageSize, long flashPromotionId, long flashPromotionSessionId) {
        IPage page = new Page();
        page.setCurrent(pageNum);
        page.setSize(pageSize);
        return promotionProductRelationMapper.selectProductByFlashIdAndFlashSessionId(page, flashPromotionId, flashPromotionSessionId);
    }
}
